export default function useToast() {
  const showToast = (content: string, icon: 'success' | 'loading' | 'fail' | 'exception' | 'error' | 'none' = 'none') => {
    return new Promise<boolean>((resolve, reject) => {
      uni.showToast({
        title: content,
        icon,
        mask: true,
        duration: 1500,
        success: () => {
          resolve(true);
        },
        fail: () => {
          reject(false);
        },
      });
    });
  };
  return {
    showToast,
  };
}
